<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<AddressBook.Controllers.SearchViewModel>" %>
<%@ Import Namespace="AddressBook.Models"%>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Results
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Results</h2>
    
    <table>
    <tr>
        <td></td>
        <td>First Name</td>
        <td>Last Name</td>
        <td>City</td>
    </tr>
    <%
        foreach (var person in (IList<Person>)ViewData.Model.Flowdata["persons"])
        {   %>    
                                                                
            <tr>
            <td style="vertical-align:top;">
                <%=
            Html.ActionLink("Details", "details", ViewData.Model.Key.ToString()) %>                       
            </td>
            <td  style="vertical-align:top;">
                <%=person.FirstName %>
            </td>
            <td style="vertical-align:top;">
                <%=person.LastName %>
            </td>
            <td style="vertical-align:top;">
                <%=string.Format("{0}", person.City) %>
            </td>         
            </tr>                                                                                 
    <% } %>
    </table>

</asp:Content>
